package threadStudy;

public class JoinTest {
    public static void main(String[] args) throws InterruptedException {
        JoinStudy t1 = new JoinStudy("twj");
        JoinStudy t2 = new JoinStudy("wjy");
        t1.start();
        t1.join();
        t2.start();
    }
}

class JoinStudy extends Thread {
    JoinStudy(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println(this.getName() + ":" + i);
        }
    }
}
